package com.ykh.mybbsdemo.dao.pojo.vo;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-08-29
 * Time: 20:46
 */
//返回值
@Data
@AllArgsConstructor
public class Result {

        private boolean success;

        private int code;

        private String msg;

        private Object data;

        //成功对应的信息
        public static Result success(Object data) {
            return new Result(true,200,"success",data);
        }

        //失败返回对应信息
        public static Result fail(int code,String msg) {
            return new Result(false,code,msg,null);
        }
}
